#基础配置
FROM airdock/oraclejdk:1.8
MAINTAINER zhuqy@hongzhicn.com
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

#参数

ENV site_port 9090
ENV site_name site1
ENV profile production
ENV project_name lxsh-cer
ENV application_name common

#创建文件夹
RUN mkdir -p /u01/app/tomcat/qdhz/docker/${project_name}/${site_name}
RUN mkdir -p /u01/logs/hongzhi/${project_name}-web-pc/${site_name}

WORKDIR /u01/app/tomcat/qdhz/docker/${project_name}/${site_name}

#暴露端口
EXPOSE ${site_port}

ADD ./target/${project_name}-web-pc.jar /u01/app/tomcat/qdhz/docker/${project_name}/${site_name}/

RUN echo "当前启动jar目录为：/u01/app/tomcat/qdhz/docker/${project_name}-web-pc/${site_name}/${project_name}-web-pc.jar"

#CMD java -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -jar ${system_name}.jar --server.port=${site_port} --spring.profiles.active=${profile} --spring.application.site=${site_name}
ENTRYPOINT exec java -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -jar /u01/app/tomcat/qdhz/docker/${project_name}/${site_name}/${project_name}-web-pc.jar --server.port=${site_port} --spring.application.project-name=${application_name} --spring.profiles.active=${profile} --spring.application.site=${site_name}
#ENTRYPOINT ["ping","www.baidu.com"]
#java -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -jar lxsh-cer-web-pc.jar --server.port=$site_port --spring.profiles.active=prod